﻿using System.Web;

namespace TemplateFoundation.Handlers
{
    /// <summary>
    /// Used to avoid 404 (File not found) exceptions for files that do not exist on disk
    /// </summary>
    /// <remarks>For example used to avoid 404 exceptions for non-visual TinyMCE plugins</remarks>
    public class EmptyFileHandler : IHttpHandler
    {
        #region IHttpHandler Members

        /// <summary>
        /// Indicates that this handler can be reused for other requests
        /// </summary>
        public bool IsReusable
        {
            get { return true; }
        }

        /// <summary>
        /// No action is taken on request
        /// </summary>
        /// <param name="context"></param>
        public void ProcessRequest(HttpContext context)
        {
            context.Response.StatusCode = 200;
            context.Response.Flush();
        }

        #endregion
    }
}
